package org.jeecg.common.modules.sys.service;

import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.common.modules.sys.entity.SysAccount;
import org.jeecg.common.util.enums.SysAccountFlowTypeEnum;
import org.jeecg.common.util.enums.SysAccountTypeEnum;

import java.math.BigDecimal;

/**
 * @author guoyh
 * @ClassName SysAccountService
 * @Description
 * @since 2020/9/5 16:08
 **/
public interface ISysAccountService extends IService<SysAccount> {

    /**
     * 获取/创建系统账户
     * @param accountType
     * @return
     */
    SysAccount getOrCreateAccount(SysAccountTypeEnum accountType);

    /**
     * 账户余额变更
     * @param accountType
     * @param flowType
     * @param amount
     * @param relationId
     * @param createUser
     */
    void changeSysBalance(SysAccountTypeEnum accountType, SysAccountFlowTypeEnum flowType, BigDecimal amount, String relationId,String createUser);

}
